﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MEFMVCApp.Parts;
using System.ComponentModel.Composition;

namespace MEFMVCApp.Controllers
{
    public class HomeController : Controller
    {
        ILogger _logger;

        public HomeController()
            : this(new TraceLogger())
        { 
            
        }

        public HomeController([Import("myTraceLogger")]ILogger logger)
        {
            _logger = logger;
        }

        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
            _logger.Write("MEFMVCApp : Executing the index action method");
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
